//
//  Person.m
//  GFrameWork
//
//  Created by Leona on 14-8-20.
//  Copyright (c) 2014年 Gable. All rights reserved.
//

#import "Person.h"
@implementation Person
{
    BOOL isClearJpushAlais;//是清空极光推送别名么
}
static  Person *sharePerson =nil;

+(Person *)sharePerson
{
    @synchronized(self) {
        if (sharePerson == nil)
        {
            // assignment not done here
            sharePerson =[[self alloc] init];
            
        }
        
    }
    
    return sharePerson;
}
+(id)allocWithZone:(NSZone *)zone
{
    @synchronized(self) {
        if (sharePerson == nil) {
            
            sharePerson = [super allocWithZone:zone];
            
            return sharePerson; // assignment and return on first allocation
        }
    }
    return nil; //on subsequent allocation attempts
}


- (void)getDataDicToPerson:(NSDictionary *)dic
{
    if (dic==nil)
    {
        self.isLogined =NO;
    }
    else
    {
      self.isLogined =YES;
   
    }
}
- (id)initwithdic:(NSDictionary *)dic
{
    if (self)
    {
        self.isLogined =YES;
    }
    return self;
}
-(void)registerJpushAlais:(id)obj andType:(BOOL)isClear
{
//    NSString *name = [obj class];
//    DLOG(@"%@ 进入registerJpushAlais 成功",name);
//    isClearJpushAlais = isClear;
//    if (isClear) {
//        [JPUSHService setAlias:@"" callbackSelector:@selector(tagsAliasCallback:tags:alias:) object:self];
//    }
//    else
//    {
////        NSString *alias = [NSString MD5:self.userPhone];
////        DLOG(@"别名alias:%@",alias);
//        [JPUSHService setAlias:self.userPhone callbackSelector:@selector(tagsAliasCallback:tags:alias:) object:self];
//    }
}

//- (void)tagsAliasCallback:(int)iResCode
//                     tags:(NSSet *)tags
//                    alias:(NSString *)alias
//{
//    if (iResCode == 0) {
//        if (isClearJpushAlais) {
//             NSLog(@"别名清空成功");
//        }
//        else
//        {
//             NSLog(@"注册别名成功");
//        }
//       
//    }
//    else
//    {
//        if (isClearJpushAlais) {
//            NSLog(@"别名清空失败");
//        }
//        else
//        {
//            NSLog(@"注册别名失败");
//            
//        }
//        
//    }
//    
//}


@end
